package com.ssish.saas.eccs.mapper;

import com.ssish.saas.eccs.model.ClaimsAssessment;
import com.ssish.saas.eccs.model.ClaimsAssessmentExample;
import com.ssish.saas.eccs.model.ClaimsAssessmentKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ClaimsAssessmentMapper {
    int countByExample(ClaimsAssessmentExample example);

    int deleteByExample(ClaimsAssessmentExample example);

    @Delete({
        "delete from CLAIMS_ASSESSMENT",
        "where CLAIMS_ID = #{claimsId,jdbcType=DECIMAL}",
          "and BENEFIT_CODE = #{benefitCode,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(ClaimsAssessmentKey key);

    @Insert({
        "insert into CLAIMS_ASSESSMENT (CLAIMS_ID, BENEFIT_CODE, ",
        "CLAIM_NO, AMT_INCURRED, ",
        "AMT_APPROVED, AMT_TO_PAY, ",
        "NOTE, LASTEDIT_DATE, ",
        "USER_CODE, AUD, REM, ",
        "AMT_INCURRED_ORIG, AMT_REJECTED_HOSPITAL, ",
        "AMT_DISCOUNT, REGEXP, ",
        "FEESCH_WALKINRT, FEESCH_DISCTYP, ",
        "FEESCH_DISCVAL, FEESCH_THRESHOLD, ",
        "FEESCH_ERR, FEESCH_ATTACHTO, ",
        "FEESCH_REM, QUANTITY, ",
        "FEESCH_DISCVALMEM, AMT_DISCOUNT_MEMBER, ",
        "DEDUCTIBLE, COINSR_BY_CLAIMANT, ",
        "INSERT_BY, INSERT_DATE)",
        "values (#{claimsId,jdbcType=DECIMAL}, #{benefitCode,jdbcType=CHAR}, ",
        "#{claimNo,jdbcType=CHAR}, #{amtIncurred,jdbcType=DECIMAL}, ",
        "#{amtApproved,jdbcType=DECIMAL}, #{amtToPay,jdbcType=DECIMAL}, ",
        "#{note,jdbcType=VARCHAR}, #{lasteditDate,jdbcType=TIMESTAMP}, ",
        "#{userCode,jdbcType=VARCHAR}, #{aud,jdbcType=VARCHAR}, #{rem,jdbcType=VARCHAR}, ",
        "#{amtIncurredOrig,jdbcType=DECIMAL}, #{amtRejectedHospital,jdbcType=DECIMAL}, ",
        "#{amtDiscount,jdbcType=DECIMAL}, #{regexp,jdbcType=VARCHAR}, ",
        "#{feeschWalkinrt,jdbcType=DECIMAL}, #{feeschDisctyp,jdbcType=CHAR}, ",
        "#{feeschDiscval,jdbcType=DECIMAL}, #{feeschThreshold,jdbcType=DECIMAL}, ",
        "#{feeschErr,jdbcType=CHAR}, #{feeschAttachto,jdbcType=VARCHAR}, ",
        "#{feeschRem,jdbcType=VARCHAR}, #{quantity,jdbcType=DECIMAL}, ",
        "#{feeschDiscvalmem,jdbcType=DECIMAL}, #{amtDiscountMember,jdbcType=DECIMAL}, ",
        "#{deductible,jdbcType=DECIMAL}, #{coinsrByClaimant,jdbcType=DECIMAL}, ",
        "#{insertBy,jdbcType=VARCHAR}, #{insertDate,jdbcType=TIMESTAMP})"
    })
    int insert(ClaimsAssessment record);

    int insertSelective(ClaimsAssessment record);

    List<ClaimsAssessment> selectByExample(ClaimsAssessmentExample example);

    @Select({
        "select",
        "CLAIMS_ID, BENEFIT_CODE, CLAIM_NO, AMT_INCURRED, AMT_APPROVED, AMT_TO_PAY, NOTE, ",
        "LASTEDIT_DATE, USER_CODE, AUD, REM, AMT_INCURRED_ORIG, AMT_REJECTED_HOSPITAL, ",
        "AMT_DISCOUNT, REGEXP, FEESCH_WALKINRT, FEESCH_DISCTYP, FEESCH_DISCVAL, FEESCH_THRESHOLD, ",
        "FEESCH_ERR, FEESCH_ATTACHTO, FEESCH_REM, QUANTITY, FEESCH_DISCVALMEM, AMT_DISCOUNT_MEMBER, ",
        "DEDUCTIBLE, COINSR_BY_CLAIMANT, INSERT_BY, INSERT_DATE",
        "from CLAIMS_ASSESSMENT",
        "where CLAIMS_ID = #{claimsId,jdbcType=DECIMAL}",
          "and BENEFIT_CODE = #{benefitCode,jdbcType=CHAR}"
    })
    @ResultMap("BaseResultMap")
    ClaimsAssessment selectByPrimaryKey(ClaimsAssessmentKey key);

    int updateByExampleSelective(@Param("record") ClaimsAssessment record, @Param("example") ClaimsAssessmentExample example);

    int updateByExample(@Param("record") ClaimsAssessment record, @Param("example") ClaimsAssessmentExample example);

    int updateByPrimaryKeySelective(ClaimsAssessment record);

    @Update({
        "update CLAIMS_ASSESSMENT",
        "set CLAIM_NO = #{claimNo,jdbcType=CHAR},",
          "AMT_INCURRED = #{amtIncurred,jdbcType=DECIMAL},",
          "AMT_APPROVED = #{amtApproved,jdbcType=DECIMAL},",
          "AMT_TO_PAY = #{amtToPay,jdbcType=DECIMAL},",
          "NOTE = #{note,jdbcType=VARCHAR},",
          "LASTEDIT_DATE = #{lasteditDate,jdbcType=TIMESTAMP},",
          "USER_CODE = #{userCode,jdbcType=VARCHAR},",
          "AUD = #{aud,jdbcType=VARCHAR},",
          "REM = #{rem,jdbcType=VARCHAR},",
          "AMT_INCURRED_ORIG = #{amtIncurredOrig,jdbcType=DECIMAL},",
          "AMT_REJECTED_HOSPITAL = #{amtRejectedHospital,jdbcType=DECIMAL},",
          "AMT_DISCOUNT = #{amtDiscount,jdbcType=DECIMAL},",
          "REGEXP = #{regexp,jdbcType=VARCHAR},",
          "FEESCH_WALKINRT = #{feeschWalkinrt,jdbcType=DECIMAL},",
          "FEESCH_DISCTYP = #{feeschDisctyp,jdbcType=CHAR},",
          "FEESCH_DISCVAL = #{feeschDiscval,jdbcType=DECIMAL},",
          "FEESCH_THRESHOLD = #{feeschThreshold,jdbcType=DECIMAL},",
          "FEESCH_ERR = #{feeschErr,jdbcType=CHAR},",
          "FEESCH_ATTACHTO = #{feeschAttachto,jdbcType=VARCHAR},",
          "FEESCH_REM = #{feeschRem,jdbcType=VARCHAR},",
          "QUANTITY = #{quantity,jdbcType=DECIMAL},",
          "FEESCH_DISCVALMEM = #{feeschDiscvalmem,jdbcType=DECIMAL},",
          "AMT_DISCOUNT_MEMBER = #{amtDiscountMember,jdbcType=DECIMAL},",
          "DEDUCTIBLE = #{deductible,jdbcType=DECIMAL},",
          "COINSR_BY_CLAIMANT = #{coinsrByClaimant,jdbcType=DECIMAL},",
          "INSERT_BY = #{insertBy,jdbcType=VARCHAR},",
          "INSERT_DATE = #{insertDate,jdbcType=TIMESTAMP}",
        "where CLAIMS_ID = #{claimsId,jdbcType=DECIMAL}",
          "and BENEFIT_CODE = #{benefitCode,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(ClaimsAssessment record);
}